object practise2 {
  def main(args: Array[String]): Unit = {

    def ispalindromic(str: String): Boolean = {
      val char = str.length
      val half_char = char / 2
      for (i <- 0 to half_char) {
        if (str(i) != str(char - i - 1)) {
          return false
        }
      }
      true
    }

    println(ispalindromic("abcdedcba")) // true
    println(ispalindromic("hello china")) // false

  }
}
